<!DOCTYPE html>
<html>
<head>
    <title>${sysEn}-品牌故事</title>
     <#include "/common/com_edit_css.ftl" >
</head>
<body>
    <div class="wrapper wrapper-content fadeInRight commoneditpage">
        <div class="row">
            <div class="col-lg-8 m-auto">
                <div class="ibox ">
                    <div class="ibox-title">
                        <h5>${actNm}-品牌故事</h5>
                    </div>
                    <div class="ibox-content">
                        <form id="form" action="${ctx}/brand_story_edit_submit.do" method="post">
                            <input type="hidden" name="id" id="id" value="${obj.id?c}">
                            <div class="form-group row"><label class="col-lg-2 col-form-label must">标题：</label>
                                <div class="col-lg-10">
                                    <input type="text" placeholder=""
                                           value="${obj.title}"
                                           id="title" name="title" class="form-control"
                                           data-easyform="null"
                                           data-message-null="标题不能为空" />
                                </div>
                            </div>
                            <@filer_tag attrNm="vedioUrl" pWidth="400" url="${obj.vedioUrl}" params="typeId=1&key=234&fileType=.mp4,.ogg,.webm" titleLabelNm="视频上传" withPreview="0"></@filer_tag>
                            <@filer_tag attrNm="imgUrl" pWidth="400"  domain="${imgdomain}" url="${obj.imgUrl}" params="typeId=1&key=123" titleLabelNm="视频图片上传"></@filer_tag>
                            <div class="form-group row">
                                <label class="col-lg-2 col-form-label">是否启用：</label>
                                <div class="col-lg-10 text-left ">
                                    <div class="i-checks">
                                        <label class="">
                                            <div class="icheckbox_square-green" style="position: relative;">
                                                <input data-easyform="null;" name="status" id="status" type="checkbox" <#if obj.status == 1>checked</#if>  style="position: absolute; opacity: 0;" >
                                                <ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
                                            </div>
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group row ">
                                <div class="col-lg-offset-2 col-lg-10">
                                    <button class="btn btn-sm btn-primary" type="button" id="signBtn" tg="ensure">确定</button>
                                    <button class="btn btn-sm btn-white" type="button" id="cancelBtn" tg="cancel">取消</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <#include "/common/com_edit_js.ftl">
    <script type="text/javascript">
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
        $(document).ready(function () {
            EditPager.init({
                container:$("#form"),
                param:function () {
                    var id = $("#id").val();
                    return {
                        id:id?id:0,
                        title:$("#title").val(),
                        imgUrl:$("#imgUrl").val(),
                        vedioUrl:$("#vedioUrl").val(),
                        status:$("#status").prop("checked")?1:0,
                    };
                }
            });
        });
        function nameValidate() {
            var curName = $("#typeName").val();
            ListPageManager.Tools.ajax({
               url:"${ctx}/fix_type_name.do",
               type:'get',
                async:false,
               data:{id:$("#id").val(),typeName:curName},
               success:function (e) {
                   if(!e.success){
                       $("#typeName").trigger("easyform-ajax", false);
                   }else{
                       $("#typeName").trigger("easyform-ajax", true);
                   }
               }
            });
        }
    </script>
</body>
</html>
